package com.wind.taobao.api.trade.item.rest
{
	import com.wind.taobao.api.trade.item.convert.ItemConvert;
	import com.wind.taobao.api.trade.item.model.TaobaoItem;
	import com.wind.taobao.core.webservice.TaobaoResponse;

	/**
	 * taobao.item.get Response
	 * @author fxy
	 *
	 */
	public class ItemGetResponse extends TaobaoResponse
	{
		public var item:TaobaoItem;

		public function ItemGetResponse(response:TaobaoResponse=null, _item:TaobaoItem=null)
		{
			super(response);
			initItem(_item);
		}

		private function initItem(_item:TaobaoItem):void
		{
			if (body != null && this.isSuccess)
			{
				if (body["rsp"].hasOwnProperty("items"))
				{
					item=ItemConvert.convertItem(body["rsp"]["items"][0], "json", _item);
				}
			}
		}

	}
}